#!/usr/bin/python

import wx,os,inspect

def here(message=''):#poor man's debugger
   here.invocation_nr+=1
   wx.LogStatus("here: %s | %d"%(str(message),here.invocation_nr))
here.invocation_nr=0

def pr(locals,print_me=False):
	pr.invocation_nr+=1
	print '-'*60, pr.invocation_nr
	s=''
	for k,v in locals.items():
		if not print_me and k=='me': continue
		s+='%-20s = %r\n'%(k,v)
	print s
pr.invocation_nr=0

ON=False

if os.path.exists('../DEBUG'):
	ON=True
	
base='../dev/corpus/'

if 0: files=['top.py','pickle.py','bzip2.c','silhouette.py','textbar.py']

if 0: files=['main_panel.py']

if 0: files=[]

if 1: files=['HIDUSBDevice.cs','bzip2.c','textbar.py','KernelRidgeRegressor.cc',
	     '000_rand_walk.py', '001_hello.py', '002_dev.py']
	
if 0: files=['empty.txt', '0_line.txt', '1_line.txt', '5_line.txt']
					
if 0: files=['empty.txt', '5_line.txt']
					
files = [base+s for s in files]
					
					
def stack():
	s='%15s\n'%"<top>"
	for fr in inspect.stack():
		s += "%15s %s\n"%(fr[1].rsplit('/',1)[-1],fr[4])
	return s
